//
//  JH_NoStateView.m
//  JiHe
//
//  Created by liuguochao on 16/5/19.
//  Copyright © 2016年 JiHe. All rights reserved.
//

#import "JH_NoStateView.h"

@implementation JH_NoStateView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.photoView];
        [self addSubview:self.titlelabel];
        [_photoView makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self);
            make.height.equalTo(RATIO(260));
        }];
        [_titlelabel makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_photoView.bottom);
            make.centerX.equalTo(self);
            make.bottom.equalTo(self);
        }];

    }
    return self;
}

- (void)configureNoStateViewWithImage:(UIImage *)image Title:(NSString *)title {
    _photoView.image = image;
    _titlelabel.text = title;
}
#pragma mark -- 懒加载
- (UIImageView *)photoView {
    if (!_photoView) {
        _photoView = [[UIImageView alloc] init];
    }
    return _photoView;
}

- (UILabel *)titlelabel {
    if (!_titlelabel) {
        _titlelabel = [[UILabel alloc] init];
        _titlelabel.font = FONT(RATIO(28));
        _titlelabel.textColor = PQ_COLOR_YELLOW;
    }
    return _titlelabel;
}
@end
